<template>
    <div>
        
        <van-search
        show-action
        label="地址"
        placeholder="请输入搜索关键词"
        >
        <template #action>
            <div >搜索</div>
        </template>
        </van-search>
        
            <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
                <van-swipe-item>1</van-swipe-item>
                <van-swipe-item>2</van-swipe-item>
                <van-swipe-item>3</van-swipe-item>
                <van-swipe-item>4</van-swipe-item>
            </van-swipe>
            <div class="main-list">
                <dl v-for="(item,index) in list" :key="index">
                    <dt>
                        <img :src="item.img" alt="">
                    </dt>
                    <dd>
                        {{item.title}}
                    </dd>
                </dl>
            </div>
        
    </div>
</template>

<script>
import request from "../../utils/request"
export default {
    name: 'index',

    data() {
        return {
            list:[]
        };
    },

    mounted() {
       
    },

    methods: {
        
    },
    async created () {
        const res = await request({
            url: '/getlist',
            method: 'post'
        })
        this.list = res.data.data
    }
};
</script>

<style lang="scss" scoped>
  .my-swipe .van-swipe-item {
    color: #fff;
    font-size: 20px;
    line-height: 150px;
    text-align: center;
    background-color: #39a9ed;
  }
  .main-list{
      width: 100%;
      height: 100px;
      dl{
          width: 25%;
          height: 100%;
          float: left;
          text-align: center;
          dt{
              width: 50px;
              height: 50px;
              border:1px solid #000;
              margin: 0 auto;
          }
      }
  }
</style>